﻿Zarejestruj się! <br>
<form name="form_poi" method="POST" action="?module=<?php
echo $_GET['module'];
?>&amp;action=addPoints" onSubmit="return IdiotCheck()">
   <table class="tabela" cellpadding="0" cellspacing="0" >
      <tr><td>Długość geograficzna (N>0)</td>
         <td><input type="text" class="styled" name="lon"></td>
      </tr>
      <tr><td>Szerokość geograficzna (E>0)</td>
         <td><input type="text" class="styled" name="lat"></td>
      </tr>
      <tr><td>Nazwa</td>
         <td><input type="text" class="styled" name="name"></td>
      </tr>
      <tr><td>Opis</td>
         <td><textarea name="desc" class="styled" cols="20" rows="2"></textarea></td>
      </tr>
      <tr>
         <script type="text/javascript" language="JavaScript">
            <!--
            document.write('<td>Kategoria</td>');
            document.write('<td><select name="kategoria" class="styled" size="8" onChange="fill(this.options.selectedIndex);" > ');
<?php
global $database;
$database->query("SELECT * FROM ucat");
while ($r=mysql_fetch_array($database->result))
{
   echo 'document.write(\'<option>'.$r['name'].'</option> \');
                ';
}
?>
   document.write('</select> </td></tr>');
   document.write('<tr><td>Podkategoria</td><td><select name="podkategoria" class="styled" size="1" ><option>Wybierz kategorię</option></select> ');
   document.write('</td></tr><tr><td></td><td> ');
   //-->
         </script>
         <noscript>
            <?php
            include("noJS.php");
            ?>
         </noscript>
         <input type="submit" value="Zapisz">
      </tr>
   </table>
</form>

<script type="text/javascript" language="JavaScript">
   <!--
   var groups=document.form_poi.kategoria.options.length;
   var group=new Array(groups);
   for (i=0; i<groups; i++)
      group[i]=new Array();
<?php
$i= 0;
//wczytywanie z DB podkategorii
$database->query("SELECT * FROM ucat");
$result=$database->getReturn();
while ($r=mysql_fetch_array($result))
{
   $n =$r['ID'];
   $database->query("SELECT * FROM `cat` WHERE `id_ucat` =$n");
   $j=0;
   while ($r2=mysql_fetch_array($database->result))
   {
      echo 'group['.$i.']['.$j++.']=new Option("'.$r2['name'].'","'.$r2['ID'].'");
           ';
   }
   $i++;
}
?>
   var temp=document.form_poi.podkategoria;
   -->
</script>
